#!/bin/bash
#date:2017.06.06
oraclemem(){
ps aux|grep "oracle"|grep -v "grep"|grep -v "processstatus.sh"|awk '{sum+=$4};END{print sum}'
}
javamem(){
ps aux|grep "java"|grep -v "grep"|grep -v "processstatus.sh"|awk '{sum+=$4};END{print sum}'
}

case "$1" in
oraclemem)
oraclemem
;;

javamem)
javamem
;;

*)
echo "Usage:$0 {oraclemem|javamem}"
;;

esac